package com.zhang.remoteapi.feign.fallbackImpl;

import com.zhang.common.core.po.admin.SysLog;
import com.zhang.common.core.vo.Result;
import com.zhang.common.core.dto.UserInfo;
import com.zhang.remoteapi.feign.AdminServiceFeign;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @Description
 * @Author zsw
 * @Date 2019/11/8 9:37
 * @Version V1.0
 **/

@Component
@Slf4j
public class AdminServiceFeignFallbackImpl implements AdminServiceFeign {

    @Setter
    private Throwable cause;

    @Setter
    private Result result ;

    @Override
    public Result<UserInfo> findByUsername(String username, String from) {
        log.error("feign 查询用户信息失败:{}", username, cause);
        return result;
    }

    @Override
    public Result<String> saveSysLog(SysLog sysLog) {
        log.error("feign 插入日志失败", cause);
//        cause.printStackTrace();
        return result;
    }
}